Page({

  data: {
    url: '',
    rich_html:'',
    gqm:'',
    title:'立即签名'
  },


  onLoad(options) {
    wx.removeStorageSync('qm_src')
    this.setData({
      url: decodeURIComponent(options.url)
    })
    this.get_rich()
  },

  onShow(){
    if(wx.getStorageSync('qm_src')){
      this.setData({
        gqm:wx.getStorageSync('qm_src'),
        title:'已签名'
      })
      this.get_rich('&gqm='+this.data.gqm+'&calltype=3')
    }
  },

  get_rich(gqm='') {
    wx.request({
      url: this.data.url+gqm,
      method: "POST",
      header: {
        "Content-Type": "application/json"
      },
      success: (res) => {
        if(gqm){
          getApp().showModal(res.data.msg).then(()=>{
            if(res.data.code==1){
              wx.navigateBack()
            }
          })
        }else{
          this.setData({
            rich_html:res.data
          })
        }
      }
    })
  },

  bottomTaps(){
    wx.navigateTo({
      url: '/handwriting/handwriting',
    })
  },

})